import 'package:flutter/material.dart';
import 'package:s_mankey/ui/page/EnterpriseWidget/enterprise_detail.dart';
import 'package:s_mankey/ui/page/EnterpriseWidget/search_enterprise.dart';
import 'package:s_mankey/ui/page/MyWidget/check_info.dart';
import 'package:s_mankey/ui/page/MyWidget/choose_source.dart';
import 'package:s_mankey/ui/page/MyWidget/edit_info.dart';
import 'package:s_mankey/ui/page/MyWidget/edit_input.dart';
import 'package:s_mankey/ui/page/MyWidget/my_videos.dart';
import 'package:s_mankey/ui/page/MyWidget/scan.dart';
import 'package:s_mankey/ui/page/MyWidget/system_notice.dart';
import 'package:s_mankey/ui/page/MyWidget/videos_detail.dart';
import 'package:s_mankey/ui/page/enterprise_page.dart';
import 'package:s_mankey/ui/page/homeWidget/audio_detail.dart';
import 'package:s_mankey/ui/page/homeWidget/audio_favorites.dart';
import 'package:s_mankey/ui/page/homeWidget/audio_list.dart';
import 'package:s_mankey/ui/page/homeWidget/home_search.dart';
import 'package:s_mankey/ui/page/loginWidget/login_page.dart';
import 'package:s_mankey/ui/page/moreWidget/binding_account.dart';
import 'package:s_mankey/ui/page/moreWidget/change_password.dart';
import 'package:s_mankey/ui/page/moreWidget/new_pasword.dart';
import 'package:s_mankey/ui/page/moreWidget/student_authenticat.dart';
import 'package:s_mankey/ui/page/moreWidget/setting.dart';
import 'package:s_mankey/ui/page/moreWidget/select_city.dart';
import 'package:s_mankey/ui/page/myWidget/choose_source1.dart';
import 'package:s_mankey/ui/page/myWidget/confirm_invite.dart';
import 'package:s_mankey/ui/page/myWidget/course_detail.dart';
import 'package:s_mankey/ui/page/myWidget/invite-detail.dart';
import 'package:s_mankey/ui/page/myWidget/invite_record.dart';
import 'package:s_mankey/ui/page/myWidget/system_msg_detail.dart';
import 'package:s_mankey/ui/page/tab_nav.dart';
import 'package:s_mankey/ui/widget/page_route_amin.dart';
import 'package:s_mankey/ui/widget/webView.dart';

///配置路由名称
class RouterName {
  static const String tabNav = '/tabNav';
  static const String growingPage = '/growingPage';
  static const String localeWidget = '/localeWidget';
  static const String settingCity = '/settingCity';
  static const String scanPage = '/scanPage';
  static const String homeSerch = '/homeSerch';
  static const String webView = '/webView';
  static const String showDialogDemo  = '/showDialogDemo';
  static const String audioList  = '/audioList';
  static const String audioDetail  = '/audioDetail';
  static const String audioFavorites  = '/audioFavorites';
  static const String demo1  = '/demo1';
  static const String demo2  = '/demo2';

  ///诚信商圈
  static const String searchEnteprise  = '/searchEnteprise';

  ///我的页面跳转
  static const String waller  = '/waller';
  static const String chooseSource  = '/chooseSource';
  static const String chooseSource1  = '/chooseSource1';
  static const String myVideos  = '/myVideos';
  static const String systemNotice  = '/systemNotice';
  static const String videosDetail  = '/videosDetail';
  static const String checkInfo  = '/checkInfo';
  static const String editInfo  = '/editInfo';
  static const String courseDetail  = '/courseDetail';
  static const String confirmINvite  = '/confirmINvite';
  static const String inviteRecord  = '/inviteRecord';
  static const String inviteDetail  = '/inviteDetail';
  static const String systemMsgDetail  = '/systemMsgDetail';

  ///更多页面跳转
  static const String studentAuthenticat  = '/studentAuthenticat';
  static const String moreSetting = '/moreSetting';
  static const String bindingAccount = '/bindingAccount';
  static const String newPasword = '/newPasword';
  static const String changePasword = '/changePasword';

  ///登录页
  static const String loginPage = '/loginPage';

  ///企业
  static const String enterpriseDetail = '/enterpriseDetail';

  ///公用的组件
  static const String editInput = '/editInput';
}

///定制路由跳转
class Router {
  static Route<dynamic> generateRoute(RouteSettings settings) {
    switch (settings.name) {
      case RouterName.tabNav:
        return NoAnimRouteBuilder(TabNav());
      case RouterName.growingPage:
        return NoAnimRouteBuilder(EnterprisePage(arguments: settings.arguments)); //arguments不能填错.
      case RouterName.moreSetting:
        return NoAnimRouteBuilder(Setting());
      case RouterName.settingCity:
        return NoAnimRouteBuilder(SelectCity());
      case RouterName.scanPage:
        return NoAnimRouteBuilder(ScanPage());
      case RouterName.homeSerch:
        return NoAnimRouteBuilder(HomeSearch());
      case RouterName.chooseSource:
        return NoAnimRouteBuilder(ChooseSource());
      case RouterName.chooseSource1:
        return NoAnimRouteBuilder(ChooseSource1(arguments: settings.arguments));
      case RouterName.myVideos:
        return NoAnimRouteBuilder(MyVideos());
      case RouterName.systemNotice:
        return NoAnimRouteBuilder(SystemNotice(arguments: settings.arguments));
      case RouterName.videosDetail:
        return NoAnimRouteBuilder(VideosDetail(arguments: settings.arguments));
      case RouterName.webView:
        return NoAnimRouteBuilder(WebView(arguments: settings.arguments));
      case RouterName.studentAuthenticat:
        return NoAnimRouteBuilder(StudentAuthenticat());
      case RouterName.moreSetting:
        return NoAnimRouteBuilder(Setting());
      case RouterName.systemMsgDetail:
        return NoAnimRouteBuilder(SystemMsgDetail(arguments: settings.arguments,));
      case RouterName.newPasword:
        return NoAnimRouteBuilder(NewPasword());
      case RouterName.bindingAccount:
        return NoAnimRouteBuilder(BindingAccount());
      case RouterName.searchEnteprise:
        return NoAnimRouteBuilder(SearchEnterprise());
      case RouterName.checkInfo:
        return NoAnimRouteBuilder(CheckInfo());
      case RouterName.editInfo:
        return NoAnimRouteBuilder(EditInfo());
      case RouterName.courseDetail:
        return NoAnimRouteBuilder(CourseDetail());
      case RouterName.audioList:
        return NoAnimRouteBuilder(AudioList(),);
      case RouterName.confirmINvite:
        return NoAnimRouteBuilder(ConfirmInvite(arguments: settings.arguments,));
      case RouterName.inviteRecord:
        return NoAnimRouteBuilder(InviteRecord(arguments: settings.arguments,));
      case RouterName.audioDetail:
        return NoAnimRouteBuilder(AudioDetail(arguments: settings.arguments,));
      case RouterName.audioFavorites:
        return NoAnimRouteBuilder(AudioFavorites());
      case RouterName.inviteDetail:
        return NoAnimRouteBuilder(InviteDetail(arguments: settings.arguments));
      case RouterName.editInput:
        return NoAnimRouteBuilder(EditInput(arguments: settings.arguments,));
      case RouterName.changePasword:
        return NoAnimRouteBuilder(ChangePassword());
      case RouterName.loginPage:
        return NoAnimRouteBuilder(LoginPage());
      case RouterName.enterpriseDetail:
        return NoAnimRouteBuilder(EnterpriseDetail(arguments: settings.arguments,));
      default:
        return MaterialPageRoute(builder: (context) => TabNav());
    }
  }
}

